package god530.com.simpleapp_slide.account.tabs.account.presenter;

import java.util.List;

import god530.com.simpleapp_slide.account.title.db.AccountTypeDBHelper;
import god530.com.simpleapp_slide.account.tabs.account.model.AccountModel;
import god530.com.simpleapp_slide.account.tabs.account.view.IAccountView;
import god530.com.simpleapp_slide.account.utils.MyLog;

/**
 * Created by root on 16-1-31.
 */
public class AccountTypePresenter {
    private IAccountView iAccountView;

    public AccountTypePresenter(IAccountView iAccountView) {
        this.iAccountView = iAccountView;
    }

    // 保存数据
    public void saveAccountModel(AccountModel accountModel) {
        AccountModel accountModel1 = new AccountModel();
        AccountTypeDBHelper.getInstance(iAccountView.getContext()).insert(accountModel1);
    }

    // 加载数据
    public List<AccountModel> loadAccountModel() {
        List<AccountModel> listAccountModel = AccountTypeDBHelper.getInstance(iAccountView.getContext()).query();
        iAccountView.setListAccountType(listAccountModel);
        MyLog.i("listAccountModel:"+listAccountModel);
        return listAccountModel;
    }

    // 更新数据
    public void updateAccountModel() {

    }
}
